/*
	the ball
*/
#pragma once

#include <hge.h>
#include <hgesprite.h>
#include <hgevector.h>
#include "obstacle.h"

extern HGE *hge;
class Obstacle;

enum Status;

class Ball {
public:
	Ball();
	~Ball();
	
	float x;
	float y;
	/*float w;
	float h;*/
	float speed;
	float drag;
	float dx;
	float dy;
	float rotation;
	float rotationIncrement;
	hgeVector direction;
	hgeVector travel;
	hgeRect *box;
	//hgeVector *position;
	
	bool IsCaught();
	bool Dying();
	void Die();
	bool Won();
	void Movement();
	void Collide();
	void Rotate(float dt, int whichWay);
	void Move(float dt, int whichWay);
	void Shoot();
	//void Bounce(int dir);//primitive bouncing
	int Bounce(Obstacle *obstacle); //bounce of the future
	bool Collision();
	hgeRect* Box();
	void Render();
	void Render(float x, float y);
	//float angle;
private:
	hgeSprite *spr;
	HTEXTURE tex;
	Status state;
	bool won;

	void Win();
	void CatchMe();	
};